import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/profile'
  },
  {
    path: '/profile',
    name: 'profile',
    component: () => import('@/views/ProfileEditor.vue'),
    meta: {title: '个人信息'}
  },
  {
    path: '/list',
    name: 'focus',
    component: () => import("@/views/MyList.vue"),
    meta: {title: '关注/粉丝'}
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

router.afterEach((to) => {
  document.title = to.meta.title as string
})

export default router
